package com.example.demo;

import com.example.demo.entity.Student;

import java.util.Comparator;
import java.util.Iterator;
import java.util.TreeSet;

/**
 * Created by asus on 2016/6/30.
 */
public class Test {
    public static void main(String[] args) {
        TreeSet<String> t = new TreeSet();
        t.add("12");
        t.add("122");
        t.add("123");

        Iterator it = t.iterator();
        while(it.hasNext()){
            System.out.println(it.next());
        }
    }
}

class MyCompare implements Comparator<Student>
{
    public int compare(Student o1, Student o2){
        return Integer.parseInt(String.valueOf(o1.getName().compareTo(o1.getName())));
    }
}













